package com.mini.model;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author shixiaopeng  on 2020/12/2
 *
 * 机会对应的微信号，昵称，头像等信息
 */
@Entity(name = "business_chance_wechat")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@DynamicUpdate
@DynamicInsert
public class BusinessChanceWechat implements Serializable{

    /**
     * id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "机会id")
    @Column(name = "chance_id")
    private Long chanceId;

    /**
     * 微信号
     */
    @ApiModelProperty(value = "微信号")
    @Excel(name = "微信号")
    private String wechatNo;

    @ApiModelProperty(value = "微信id")
    @Excel(name = "微信id")
    private String wxId;

    @ApiModelProperty(value = "微信昵称")
    @Excel(name = "微信昵称")
    private String nickName;

    @ApiModelProperty(value = "运营专员Id")
    private Long teacherId;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(insertable = false, updatable = false)
    Date createTime;
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(insertable = false, updatable = false)
    Date updateTime;
    @ApiModelProperty(value = "备注")
    @Excel(name = "备注")
    private String remark;
    @ApiModelProperty(value = "头像")
    @Excel(name = "头像")
    private String headImg;
    @ApiModelProperty(value = "性别:1男，2女,0(未知)")
    private Integer sex;
    @ApiModelProperty(value = "祖国")
//    @Excel(name = "祖国")
    private String country;
    @ApiModelProperty(value = "省份")
//    @Excel(name = "省份")
    private String province;
    @ApiModelProperty(value = "城市")
//    @Excel(name = "城市")
    private String city;
    @ApiModelProperty(value = "微信条数")
    @Excel(name = "微信条数")
    private Integer chatNum;
    @ApiModelProperty(value = "加微状态")
    private Boolean isAdd = false;
    @Excel(name = "加微状态")
    @Transient
    private String isAddDesc = "无";

    @ApiModelProperty(value = "录入类型，0表单名片，1在线名片，2手动录入")
    private Integer enterType;

    @ApiModelProperty(value = "在线名片信息")
    private String onlineCard;

    @ApiModelProperty(value = "是否置顶展示")
    private Boolean frontDiaplay;


    @ApiModelProperty(value = "微信号,不脱敏")
    @Transient
    private String realWechatNo;

    @ApiModelProperty(value = "时间戳，前端排序用")
    @Transient
    private Long timestamp;
}
